package com.cheneyjoo.controller;

import com.cheneyjoo.factory.ClassFactory;
import com.cheneyjoo.model.STUDENT_CLASS;
import com.cheneyjoo.service.IStudentClassService;

import java.util.Arrays;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;

public class StudentClassController {
    private final IStudentClassService studentClassService;

    public StudentClassController() {
        studentClassService = ClassFactory.getStudentClassService();
    }

    /**
     * 添加班级信息
     *
     * @param student_class 班级信息
     * @return 是否成功
     */
    public boolean addStudentClass(STUDENT_CLASS student_class) {
        return studentClassService.addStudentClass(student_class);
    }

    /**
     * 修改班级信息
     *
     * @param student_class 班级信息
     * @return 是否成功
     */
    public boolean updateStudentClass(STUDENT_CLASS student_class) {
        return studentClassService.updateStudentClass(student_class);
    }

    /**
     * 删除班级信息
     *
     * @param id 班级id
     * @return 是否成功
     */
    public boolean deleteStudentClass(int id) {
        return studentClassService.deleteStudentClass(id);
    }

    /**
     * 查询一个班级信息
     *
     * @param id 主键ID
     * @return 班级对象
     */
    public STUDENT_CLASS getStudentClass(int id) {
        return studentClassService.getStudentClass(id);
    }

    /**
     * 获取班级列表
     *
     * @param where where条件键值队
     * @return 班级列表集合
     */
    public Map<String, Object> getStudentClasses(int pageSize, int currPage, Map<String, String> where) {
        return studentClassService.getStudentClasses(pageSize, currPage, where);
    }
}
